<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:v-on="http://www.w3.org/1999/xhtml">

	<head>
		<meta charset="UTF-8">
		<title>三诺分钟诊所</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="../css/font.css">
		<link rel="stylesheet" href="../css/xadmin.css">
		<script src="../js/jquery.min.js"></script>
		<script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="../js/xadmin.js"></script>
		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
	  <script src="/js/vue.js"></script>
    <![endif]-->
	</head>

	<body class="form-wrap">

		<div class="layui-fluid" id="addcustomer">
			<div class="layui-card">
				<div class="layui-card-header">新增检测者</div>
				<div class="layui-card-body" style="padding: 15px;">
					<form class="layui-form" action="" lay-filter="component-form-group" style="border-left-width: 400px;">
						<div class="layui-form-item">
							<label class="layui-form-label">联系电话 <span class="x-red">*</span></label>

							<div class="layui-input-block">
								<input type="tel" name="phone" id="jcphone" maxlength="11" lay-verify="required|phone" autocomplete="off" placeholder="请输入" class="layui-input">
							</div>
						</div>

						

						<div class="layui-form-item">
							<label class="layui-form-label">性别</label>
							<div class="layui-input-block">
								<input type="radio" name="sex" value="1" title="男" checked="" class="sex">
								<div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i>
									<div>男</div>
								</div>
								<input type="radio" name="sex" value="0" title="女" class="sex">
								<div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i>
									<div>女</div>
								</div>
								<input type="radio" name="sex" value="禁" title="禁用" disabled="" class="sex">
								<div class="layui-unselect layui-form-radio layui-radio-disbaled layui-disabled"><i class="layui-anim layui-icon"></i>
									<div>禁用</div>
								</div>
							</div>
						</div>
<div class="layui-form-item">
							<label class="layui-form-label">姓名 <span class="x-red">*</span></label>
							<div class="layui-input-block">
								<input type="text" id="username" name="username" required lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">年龄</label>
							<div class="layui-input-block">
								<input class="layui-input" type="text" id="jcage" placeholder="请输入">
				  </div>
				</div>
					<div class="layui-form-item">
							<label class="layui-form-label">身份证号</label>
							<div class="layui-input-block">
								<input class="layui-input" type="text" maxlength="18" id="jcidentityCard" placeholder="请输入">
				  </div>
				</div>
        </form>
        <div style="margin-left: 640px; margin-top: 56px; ">
					<button type="button" id="AddCust" class="layui-btn" lay-submit="" lay-filter="sreach"><a href="examiner_add_list.html">下一步</a></button>
								
			
			</div>
		</div>
      </div>
    </div>
  </div>

    
  <script>

	  $(function () {

          $("#AddCust").click(function () {

              var phone = $("#jcphone");
              var username = $("#username");
              var sex = $(".sex").val();
              var cage = $("#jcage");
              var identityCard = $("#jcidentityCard");

              if (phone.val() == "") {
                  layer.msg("检测者手机号不能为空", {time: 1000, icon: 5, shift: 6});
                  return false;
              }

              if (username.val() == "") {
                  layer.msg("检测者姓名不能为空", {time: 1000, icon: 5, shift: 6});
                  return false;
              }

              if (cage.val() == "") {
                  layer.msg("检测者年龄不能为空", {time: 1000, icon: 5, shift: 6});
                  return false;
              }

              if (identityCard.val() == "") {
                  layer.msg("检测者身份证号不能为空", {time: 1000, icon: 5, shift: 6});
                  return false;
              }

              $.ajax({
                  url : "/addUser",
                  type : "post",
                  data:{
                      "cphone" : phone.val(),
                      "csex" : sex,
                      "cname" : username.val(),
                      "cage" : cage.val(),
                      "identityCard" : identityCard.val()
                  },
                  success:function (result) {
                      console.log(result);
                  }
              })

          })

      })

	  
  layui.config({
    base: '../../../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'laydate'], function(){
    var $ = layui.$
    ,admin = layui.admin
    ,element = layui.element
    ,layer = layui.layer
    ,laydate = layui.laydate
    ,form = layui.form;
    
    form.render(null, 'component-form-group');

    laydate.render({
      elem: '#LAY-component-form-group-date'
    });
    
/* 监听提交 */
    form.on('submit(component-form-demo1)', function(data){
      parent.layer.alert(JSON.stringify(data.field), {
        title: '最终的提交信息'
      })
      return false;
    });

  });
  </script>


</body>


</html>